package test.vos;

import java.util.Iterator;

import vos.Kit;
import controller.ArticuloComponente;

public class Cliente {
	ArticuloComponente allArticulos;
	
	public Cliente(ArticuloComponente allArticulos){
		this.allArticulos = allArticulos;
	}
	
	public Double imprimirArticulos(){		
		return allArticulos.getPrecio();
	}
	
	public Kit searchEndKit(ArticuloComponente kit){
		Kit returnKit = (Kit)kit;
		Iterator<ArticuloComponente> iterator =  kit.getDetalles().iterator();
		while (iterator.hasNext()) {//saca el siguiente elemento
			ArticuloComponente articuloComponente = (ArticuloComponente) iterator.next();
			if(articuloComponente instanceof Kit){
				returnKit = (Kit)articuloComponente;
				searchEndKit(articuloComponente);
			}
		}
		return returnKit;
	}

}
